package com.gx.ring.service;

import java.sql.Connection;

import com.gx.ring.dao.RingBaseInterfaceDAO;
import com.gx.ring.dao.impl.CIInterfaceImplDAO;
import com.gx.ring.dao.impl.FLInterfaceImplDAO;
import com.gx.ring.dao.impl.MFInterfaceImplDAO;
import com.gx.ring.dao.impl.PDRInterfaceImplDAO;
import com.gx.ring.dao.impl.PLInterfaceImplDAO;
import com.gx.ring.dao.impl.ULInterfaceImplDAO;
import com.gx.ring.dao.impl.USIInterfaceImplDAO;

public class QueryServiceFactory {
	private QueryServiceFactory(){}
	
	public static  RingBaseInterfaceDAO<?> getDAO(String option,Connection conn){
		RingBaseInterfaceDAO<?> rbd = null;
		switch (option) {
		case "corpinfo":
			rbd = new CIInterfaceImplDAO(conn);
			break;
		case "userinfo":
			rbd = new USIInterfaceImplDAO(conn);
			break;
		case "failreglog":
			rbd = new FLInterfaceImplDAO(conn);
			break;
		case "monthfee":
			rbd = new MFInterfaceImplDAO(conn);
			break;
		case "personaldownreport":
			rbd = new PDRInterfaceImplDAO(conn);
			break;
		case "personallib":
			rbd = new PLInterfaceImplDAO(conn);
			break;
		case "userlog":
			rbd = new ULInterfaceImplDAO(conn);
			break;
		default:
			break;
		}
		
		return rbd;
	}
}
